﻿package com.firewolf.sington.allsingtons;
/**
 * 经典的单例模式,多线程的时候会发生混乱
 * @author liuxing0
 * @function
 * @createtime 2014-9-10
 */
public class ClassicalSingleton {
	private static ClassicalSingleton uniqueInstance;
	private ClassicalSingleton(){} //私有构造方法
	public static ClassicalSingleton getInstance(){
		if(uniqueInstance == null){
			uniqueInstance = new ClassicalSingleton();
		}
		return uniqueInstance;
	}
	
	//////////////////////////////////////
	/**other methods*/
	
	public void description(){
		System.out.println("xxxx,这是最经典的单例模式的其他方法，不考虑多线程的时候，就用我吧！！！");
	}
}
